using System;   
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Text;

namespace BetterEventViewer.Core
{
    public class BetterEventLog
    {
        public EventLog Component;

        public Collection<BetterEventLogEntry> BetterEventLogEntries
        {
            get 
            {
                Collection<BetterEventLogEntry> list = new Collection<BetterEventLogEntry>();

                foreach (EventLogEntry obj in Component.Entries )
                {
                    BetterEventLogEntry entry = new BetterEventLogEntry();
                    entry.Component = obj;
                    list.Add(entry);
                }

                return list;
            }
        }

        public string Name
        {
            get { return Component.LogDisplayName; }
        }

        public void ClearEntries()
        {
            Component.Clear();
        }

        public void Delete()
        {
            if( Component.LogDisplayName!="Security")
                EventLog.Delete(Component.LogDisplayName);
        }
    }
}
